package com.spotimage.wsn;

import java.util.List;
import java.util.Map;


public interface ISubscriptionDB extends Map<String, SubscriptionInfo>
{
	
	/**
	 * Retrieves the list of all subscriptions associated to a given user ID
	 * @param userID
	 * @return subscription list, empty list if the user has no subscriptions attached or null if user ID does not exist 
	 */
	public List<SubscriptionInfo> getUserSubscriptions(String userID);
	
	
	/**
	 * Checks that the suscription is valid for the particular application
	 * For example id a topic is specified it should be one of the topics advertised by the notification service
	 * @param sub
	 * @throws IllegalArgumentException thrown if the subscription is not valid with the appropriate message
	 */
	public void checkSubscription(SubscriptionInfo sub) throws IllegalArgumentException;
	
	
	public String generateNewSubscriptionID();
}
